import 'package:cc_sdk/models/json_interface.dart';

class CommentModel  {
  int commentId;
  int parentId;
  int memberId;
  String outId;
  String context;
  int likeCount;
  int replyCount;
  String createTime;
  String updateTime;
  int hotVal;
  bool fixTop;
  int type;
  List<CommentModel> replyList;
  bool myLike;

  CommentModel.fromMap(Map<String, dynamic> map) {
    commentId = int.parse(map['commentId'].toString());
    parentId = int.parse(map['parentId'].toString());
    memberId = int.parse(map['memberId'].toString());
    outId = map['outId'];
    context = map['context'];
    likeCount = int.parse(map['likeCount'].toString());
    replyCount = int.parse(map['replyCount'].toString());
    createTime = map['createTime'].toString();
    updateTime =map['updateTime'].toString();
    hotVal = int.parse(map['hotVal'].toString());
    fixTop = map['fixTop'];
      myLike = map['myLike'];
    type = int.parse(map['type'].toString());
    replyList = [];
    if (map["replyList"] != null && map["replyList"].length > 0) {
      var childs = map["replyList"] as List<Map<String, dynamic>>;
      for (var item in childs) {
        replyList.add(CommentModel.fromMap(item));
      }
    }
  }
}
